#define DEBUG
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn=1000, maxx=10000;

class Point {
    public:
        int x, y, v;
        double ang;

        Point(){}

        Point(int _x, int _y, int _v) {
            x = _x;
            y = _y;
            v = _v;
            ang = atan2(_y, _x);
            if (ang<-M_PI/2) {
                ang += 2*M_PI;
            }
        }

        static bool cmp(Point &a, Point &b) {
            return a.ang<b.ang;
        }

        static bool ncmp(Point &a, Point &b) {
            return a.ang>b.ang;
        }

        Point operator-(Point t) {
            return Point(x-t.x, y-t.y, v);
        }
};

class TreeArray {
    public:
        static const int n=maxx;
        int v[2*maxx+1];

        int lowbit(int x) {
            return x&(-x);
        }

        void add(int o, int tv) {
            for (; o<=n; o+=lowbit(o)) {
                v[o] += tv;
            }
        }

        int get(int o) {
            int ret=0;
            for (; o>0; o-=lowbit(o)) {
                ret += v[o];
            }
            return ret;
        }
};

void count(int n, Point p[], int sum[]) {
    static TreeArray ta;
    memset(ta.v, 0, sizeof ta.v);
    for (int i=1; i<=n; i++) {
        if (p[i].v<0) {
            ta.add(abs(p[i].x), -p[i].v);
        } else {
            sum[p[i].v] = ta.get(abs(p[i].x)-1);
        }
    }
}

int main() {
#ifdef DEBUG
    freopen("src.in", "r", stdin);
    freopen("src.out", "w", stdout);
#endif

    static Point p[maxn+1], frog[maxn+1];
    static int sum[maxn+1][maxn+1], suml[maxn+1];
    int n, m;
    scanf("%d %d", &n, &m);
    for (int i=1; i<=n; i++) {
        int x, y;
        scanf("%d %d", &x, &y);
        p[i] = Point(x, y, i);
    }
    for (int i=1; i<=m; i++) {
        int x, y, v;
        scanf("%d %d %d", &x, &y, &v);
        frog[i] = Point(x, y, -v);
    }

    for (int i=1; i<=n; i++) {
        for (int j=1; j<=m; j++) {
            if (frog[j].x==p[i].x && frog[j].y<=p[i].y) {
                suml[i] += -frog[j].v;
            }
        }

        static Point temp[2*maxn+1];
        int size=0;
        for (int j=1; j<=n; j++) {
            if (i!=j && p[j].x>p[i].x) {
                temp[++size] = p[j]-p[i];
            }
        }
        for (int j=1; j<=m; j++) {
            if (frog[j].x>p[i].x) {
                temp[++size] = frog[j]-p[i];
            }
        }
        sort(temp+1, temp+size+1, Point::cmp);
        count(size, temp, sum[i]);

        size=0;
        for (int j=1; j<=n; j++) {
            if (i!=j && p[j].x<p[i].x) {
                temp[++size] = p[j]-p[i];
            }
        }
        for (int j=1; j<=m; j++) {
            if (frog[j].x<p[i].x) {
                temp[++size] = frog[j]-p[i];
            }
        }
        sort(temp+1, temp+size+1, Point::ncmp);
        count(size, temp, sum[i]);
    }

    int q;
    scanf("%d", &q);
    for (int i=1; i<=q; i++) {
        int s, ans=0;
        static int cir[maxn+1];
        scanf("%d", &s);
        for (int j=1; j<=s; j++) {
            scanf("%d", cir+j);
        }
        for (int j=1; j<=s; j++) {
            int a=cir[j], b=cir[j%s+1], c=cir[(j+1)%s+1],
                t = p[b].x==p[a].x ? 0 : (p[b].x>p[a].x ? 1 : -1);
            ans += sum[a][b]*t+((p[c].x-p[b].x)*(p[b].x-p[a].x)>0)*t*suml[b];
        }
        printf("%d\n", abs(ans));
    }

    fclose(stdin);
    fclose(stdout);
    return 0;
}
